package com.ys.zero.web;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.ys.zero.bean.User;



@WebServlet("/top.s")
public class topServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
	 
		User user = (User) request.getSession().getAttribute("loginedUser");
//		System.out.println(user);
		
		if(user!=null) {

		}
		Gson g = new Gson();
		String json = g.toJson(user);
//		System.out.println(json);
		response.getWriter().append(json);
		
	}


}
